home *** CD-ROM | disk | FTP | other *** search
/ PC Media 3 / PC MEDIA CD03.iso / share / udos / mcp104 / mcp.doc next >
Encoding:
Text File  |  1992-09-22  |  17.0 KB  |  402 lines

  1. MCP.DOC -- documentation for MCP.EXE
  2.  
  3.  
  4. WHAT IS THIS?
  5.  
  6. MCP (Master Copy) is kind of like XCOPY, but it normally only overwrites older
  7. files and it can move files.  It was written primarily for use in keeping
  8. directory structures shared by different people (or by the same person on
  9. different computers) in synchronization with each other.  It is also a quick
  10. way to implement disk mirroring style backups.
  11.  
  12.  
  13. HOW DO I RUN MCP?
  14.  
  15. Syntax:
  16. MCP.EXE source [destination] [switches]
  17.   /A = copy only files with Archive bit set (leave source archive bit set)
  18.   /B = ask permission Before overwriting each existing destination file.
  19.   /C = copy & overwrite all files except those with identical date, time & size
  20.   /D = copy files with date the same or later than Date given /D:mm-dd-yyyy
  21.        /D:dd.mm.yyyy /Dmm/dd/yy or /Ddd.mm.yy
  22.   /F = Force overwrite of system, hidden, and read only files
  23.   /H = Copy system and hidden files as well.
  24.   /L = Verbose output
  25.   /M = copy only files with archive bit set (Modify source archive bit)
  26.   /N = No overwrite
  27.   /O = Overwrite destination files
  28.   /P = Prompt before copy
  29.   /Q = Quiet (report only errors)
  30.   /R = Rename or move files
  31.   /S = /E = recurse through Subdirectories (& create empty ones)
  32.   /V = This switch doesn't cause an error message, but it doesn't do anything.
  33.        It is included so that batch files written for XCOPY can use MCP with
  34.        the same switches.  (/V turns verify on in XCOPY).
  35.   /W = Wait for keystroke before starting copy
  36.   /? = Show help screen.
  37.  
  38. On the command line, source is a file name or directory name, which may
  39. optionally include drive and path.  It may also include DOS wild cards ? and
  40. *.  If the source is a drive or directory, the file specification *.* is
  41. assumed.
  42.  
  43. The destination is a file name or directory.  If no destination is specified,
  44. the current directory is assumed.  If there are wild card characters in the
  45. destination file name, they will be filled in with the corresponding
  46. characters in the source file name.  If it is not obvious if the destination
  47. is a file or directory, you may be asked which you meant.  To ensure that the
  48. destination is interpreted as a directory instead of a file, end the directory
  49. name in "\" or ensure that the destination directory already exists.  If the
  50. destination directory does not exist, it will be created.
  51.  
  52. Switches all start with "/" (not "-", since - is a valid file name character
  53. in DOS), and may be before, between, and/or after the source and destination. 
  54. Switches may be combined.  In case of a conflict between switches, the one
  55. that is farthest to the right on the command line takes precedence.  For
  56. brevity, command line switches may be run together after a single "/". 
  57. Switches are not case sensitive.
  58.  
  59. /A (Archive) and /M (Modify archive) both specify that only files that have
  60. the DOS directory archive bit set (indicating that they have been changed
  61. since they were last backed up) should be copied.  /A does not alter the
  62. archive bit on the source file.  /M clears the archive bit of the source file
  63. to indicate that it has been backed up.  The archive bit of the destination
  64. file is always set when using MCP.  These options can be used for backing up
  65. data when the largest file you want to back up will fit on your destination
  66. media.  If the largest file you want to back up is bigger, a regular backup
  67. program is more appropriate than MCP.  However, for some small but important
  68. files, backing up with a copy command like MCP makes more sense, because the
  69. file itself is not altered, making restoration possible even without the
  70. original backup program.
  71.  
  72. For example,
  73. MCP /A C:\WORK\DOC\*.* A:
  74. copies all files in C:\WORK\DOC to the floppy disk in A: that have not been
  75. marked as backed up.
  76.  
  77. /B (ask Before overwrite) causes MCP to stop and ask if you want to copy each
  78. file for which the destination file already exists.
  79.  
  80. /C (Copy & overwrite all but identical date, time & size) will cause all
  81. destination files with the same name but different (older or newer) date &
  82. time or different size (smaller or larger) to be overwritten.
  83.  
  84. /D (Date) is always followed by a date, with no space in between the /D and
  85. the date.  The colon following the D is optional.  The order of the date is
  86. month day year if you use "/" or "-" to separate the numbers in the date.  If
  87. you use "." to separate the numbers in the date, the order is day month year. 
  88. The year can be specified with either the last two digits or all four digits. 
  89. If you specify the last two digits, the year is assumed to be in the range
  90. 1980 through 2079.  The month must be expressed as a number between 1 and 12. 
  91. Leading zeros on month and day are optional.
  92.  
  93. For example, the following commands all copy everything with a file date on or
  94. after December 25, 1991 from the current directory to D:\SAVE\.
  95.  
  96. MCP /D12/25/91 *.* D:\SAVE\
  97. MCP /D:12/25/91 *.* D:\SAVE\
  98. MCP *.* D:\SAVE\ /D12/25/1991
  99. MCP /D12-25-91 *.* D:\SAVE\
  100. MCP *.* /D12-25-1991 D:\SAVE\
  101. MCP /D25.12.91 *.* D:\SAVE\
  102. MCP /D:25.12.1991 *.* D:\SAVE\
  103.  
  104. /F (Force) forces overwriting of Hidden, System, and Read Only files. 
  105. WARNING:  use this option with caution.  It is very useful for some
  106. situations, but could have some undesired side effects if you overwrite some
  107. files of this type.
  108.  
  109. /H (Hidden & system) allows files with the system and hidden attribute to be
  110. copied.  Note that the XCOPY that comes with DOS 5 will not copy hidden files,
  111. but earlier versions will.  The system and hidden attributes will be applied
  112. to the destination files when they are present in the source files.  Note: 
  113. copying the two hidden system files from a boot drive to another drive will
  114. not necessarily make the destination bootable.  Use the DOS SYS command for
  115. that purpose.
  116.  
  117. /L (Loud) causes extra screen output to be generated, including the names of
  118. all files that are skipped.
  119.  
  120. /N (No overwrite) prevents any destination files from being overwritten,
  121. regardless of the file dates and attributes involved.  The default is to allow
  122. overwrites of destination files with an earlier file date.  This is the
  123. opposite of /O (Overwrite always).
  124.  
  125. /O (Overwrite always) causes destination files to be overwritten regardless of
  126. its file date.  The default is to allow overwrites only of destination files
  127. with an earlier file date.  This is the opposite of /N (No overwrite).
  128.  
  129. /P (Prompt) asks you if you want to copy each file with a Y/n prompt.  "N" or
  130. "n" will cause the file to be skipped.  Most other keys, including "Y" and "y"
  131. will cause the file to be copied.  The "Enter" key need not be pressed after
  132. the "y" or "n".
  133.  
  134. For example,
  135. MCP /P *.* A:
  136. lets you pick exactly which files you want to copy to drive A:, one by one.
  137.  
  138. /Q (Quiet) suppresses all screen output except for error messages and the help
  139. screen in response to a command line error or /?.
  140.  
  141. For example,
  142. MCP /Q /M C:\WORK\*.* F:\MASTER\FRED\
  143. in a network login script would be a subtle way to back up some critical
  144. directory on a users's hard disk to a network directory, where it could be
  145. moved to tape or something.
  146.  
  147. /R (Rename or move) causes files to be renamed if the source and destination
  148. are on the same disk, or copied then the original deleted (after a successful
  149. copy) if the source and destination are on different disks.  If the copy
  150. fails, the original is left intact.  When used with the /S option, emptied
  151. subdirectories are not removed.
  152.  
  153. For example,
  154. MCP C:\STUFF\*.DOC D:\OLDJUNK\ /R
  155. moves every .DOC file in C:\STUFF\ to D:\OLDJUNK\.
  156.  
  157. /S or /E (Subdirectory copy) copies files and subdirectories from the
  158. destination to the source, making subdirectories as needed.  Empty
  159. subdirectories are created as well.  Using /S and/or /E on the command line of
  160. MCP is the same as using both /S and /E on the command line of XCOPY.
  161.  
  162. /V does nothing.
  163.  
  164. /W (Wait) causes the prompt "Press a key when ready to start copy . . ." to be
  165. displayed, and the program to pause until you hit a key before starting the
  166. copy process.  This is for use with floppy only systems, where the MCP command
  167. may reside on a disk other than the one you want do do the copy on.
  168.  
  169. /? (Help) shows the help screen.
  170.  
  171.  
  172. ZERO LENGTH FILES
  173.  
  174. Unlike XCOPY, MCP copies zero length files and, if copying subdirectories,
  175. always copies empty subdirectories.  It also duplicates the file attributes
  176. (system, hidden, read only) of the source file in the destination file, except
  177. for the archive bit, which is always set in the destination file.
  178.  
  179.  
  180. PROMPTS
  181.  
  182. There are several prompts possible in MCP.  At each of the prompts, the
  183. default answer (if applicable) is indicated with a capital letter.  Answers to
  184. the prompts are not case sensitive, and are all only one keystroke.  Pressing
  185. "Enter" after a letter is not required.  The "Enter" key is ignored at all
  186. prompts except for the "Press a key when ready to start copy . . ." prompt
  187. caused by the /W option.  In addition to the listed responses at any prompt,
  188. "Esc", "Ctrl-C", and "Ctrl-Break" will terminate MCP.  "Ctrl-Break" will also
  189. terminate a copy in progress, even if the program is not looking for an answer
  190. to a question.
  191.  
  192.  
  193. filename Y/n?
  194.  
  195. This is the format used in asking if you want to copy a particular file when
  196. you put /P on the command line.  "N" means that you do not want to copy the
  197. file, and most other keys (including "Y") mean that you do want to copy the
  198. file.
  199.  
  200.  
  201. Only 512 bytes available on A:.  filename requires 1234 bytes.
  202. Retry with new disk, Try new disk later, Skip, or Cancel (r/T/s/c)?
  203.  
  204. If your destination is on a fixed disk, press "S" to skip just this file or
  205. "C" to cancel and exit MCP.  If your destination is a removable disk, you may
  206. skip the current file or cancel as with a fixed disk destination.  You may
  207. also wish to change disks and then press "R" to retry copying the current
  208. file, or press "T" to try copying the next file (which may fit) and add the
  209. current file to a list to be tried again later (on a different floppy disk). 
  210. Most other keys act the same as "T".
  211.  
  212.  
  213. No more room on drive A:
  214. Retry with new disk, Skip or Cancel (R/s/c)?
  215.  
  216. Your destination disk has no more room on it.  Change the disk and press "R"
  217. to retry, or "C" to exit the MCP program.
  218.  
  219.  
  220. Error writing to filename.
  221. Retry, Skip, or Cancel (r/S/c)?
  222.  
  223. MCP encountered one of many possible errors (insufficient network rights, bad
  224. disk sectors, hardware failures, disk full even though it had enough room to
  225. start the copy, etc.).  "R" restarts the copy from the beginning of the file. 
  226. "S" skips this file and tries the next.  "C" cancels the copy and exits MCP.
  227.  
  228.  
  229. Does destination specify a File name
  230. or Directory on the target (f=File, D=Directory)? 
  231.  
  232. The destination directory is not an existing directory and the name does not
  233. end with "\", and there may be more than one source file (indicated by wild
  234. cards in the name or a /S or /E switch).  Press "F" if you intended that the
  235. destination is a file name, or "D" if you intended that the destination is a
  236. directory.  If you decide that the command line was in error, press "Esc".
  237.  
  238.  
  239. Press a key when ready to start copy . . .
  240.  
  241. You used the /W option.  Press "Esc", "Ctrl-C", or "Ctrl-Break" if you decide
  242. you really didn't want to copy anything after all, or press any other key to
  243. start the copy process.
  244.  
  245.  
  246. ERROR MESSAGES
  247.  
  248. Break!
  249.  
  250. You pressed Ctrl-Break, Ctrl-C, or Esc to halt the program.
  251.  
  252.  
  253. Unable to create filename
  254.  
  255. The destination file name may have been on an invalid drive, have contained
  256. invalid characters, been in the root directory with all directory entries
  257. filled, been on a network directory with insufficient rights, been too long
  258. for DOS or the network operating system to create, or some other similar
  259. problem.
  260.  
  261.  
  262. Files may not be copied onto themselves.
  263.  
  264. The first step in copying a file is to create a new file of zero length with
  265. name of the destination file.  If the source and destination files are the
  266. same, this action would destroy the source file.
  267.  
  268.  
  269. Destination path is too long.
  270.  
  271. The most likely cause of this error message is starting a recursive copy
  272. command (like MCP /S C:\*.* C:\SUBDIR\).  This causes everything in the root
  273. directory of drive C: to be copied to C:\SUBDIR\ and C:\SUBDIR\SUBDIR\ and
  274. C:\SUBDIR\SUBDIR\SUBDIR\ and so on.  Older versions of XCOPY allow this, the
  275. latest one does not.  MCP allows the recursion to go on until the resulting
  276. path name exceeds DOS limits.  This is a great way to fill up a hard disk in a
  277. hurry.
  278.  
  279.  
  280. Not enough memory to run MCP.EXE
  281.  
  282. Try reducing the number of TSR programs, or if you are shelled out to DOS from
  283. another program, exit that other program.
  284.  
  285.  
  286. Access denied.
  287.  
  288. DOS (or some network software) returned an error code indicating that the
  289. operation was not allowed.  Some things that can do this is trying to create a
  290. directory when a file with the same name already exists or trying to write to
  291. a network directory where you have insufficient rights.
  292.  
  293.  
  294. Bad file number.
  295.  
  296. Something strange is going on that confused DOS and/or MCP -- probably some
  297. error associated with a multitasking environment.
  298.  
  299.  
  300. Attempt to copy more than one file to file.
  301.  
  302. MCP does not concatenate files (use DOS COPY to do that), so copying more than
  303. one file to a single file means that all that ends up in the destination file
  304. is the last file copied.  If this were done with the /R option, all but the
  305. last file would be destroyed.  Therefore, only one file is allowed to be
  306. copied to a file.  The trap that catches this is not foolproof (although it is
  307. reasonably difficult to fool), so you should still take care on the command
  308. line to avoid specifying such an action.
  309.  
  310.  
  311. Unable to open filename
  312.  
  313. The specified file name may not be valid, or may be on a network directory
  314. where you have insufficient rights.
  315.  
  316.  
  317. Ran out of memory keeping track of files to retry.
  318.  
  319. Each file name source and destination that is "remembered" to try later when
  320. you run out of room copying to a diskette takes up some conventional RAM. 
  321. After several thousand of these (more or less, depending on how much RAM you
  322. have available), you may run out.
  323.  
  324.  
  325. ERRORLEVEL
  326.  
  327. When running MCP in a batch file, you can test for the following values of
  328. ERRORLEVEL after MCP runs:
  329.  
  330. 0 = Normal completion.
  331. 2 = "Ctrl-Break", "Ctrl-C", or "Esc" pressed, or copy canceled with "C".
  332. 3 = Unable to write to destination file.
  333. 4 = Attempted to copy file onto itself.
  334. 5 = Destination path is too long.
  335. 6 = Not enough memory to run.
  336. 7 = Access denied.
  337. 8 = Bad file number error returned by DOS.
  338. 9 = Attempt to copy more than one file to one destination file.
  339. 11 = Command line error or help requested.
  340. 12 = Unable to open input file.
  341. 13 = Ran out of memory keeping track of files to retry.
  342.  
  343.  
  344. A COPY PROGRAM BY ANY OTHER NAME
  345.  
  346. MCP comes from M as in Master or Mike's and CP as in the name for the Unix
  347. copy command.  Call it whatever you like, by renaming it, creating an alias
  348. with DOSKEY or a similar utility, or by creating a batch file.  You might want
  349. to create a batch bile called MOVE.BAT (or MV.BAT) that contains the line:
  350.  
  351. MCP /R %1 %2 %3 %4 %5 %6 %7 %8 %9
  352.  
  353.  
  354. LIMITATIONS
  355.  
  356. MCP does not do concatenation.  It does not get the date format from the DOS
  357. country table.  It does not do Japanese dates in year-month-day format.  All
  358. of its error messages are in English.  It does not do a full screen
  359. interface.  It doesn't skip zero length files just because they are zero
  360. length.  It doesn't skip creation of empty subdirectories when /S is used. /V
  361. does absolutely nothing.  It doesn't remove any subdirectories, nor does it
  362. preserve subdirectory attributes (like the hidden bit) when copying
  363. subdirectories.  It doesn't predict winning lottery numbers.  On the other
  364. hand, it does do some things that I always thought that XCOPY should have
  365. done. 
  366.  
  367.  
  368. COPYRIGHT NOTICE & DISCLAIMER
  369.  
  370. Copyright (C) 1992 Michael Paul Johnson.  All rights reserved.  No warranty.
  371. All trademarks mentioned herein belong to their respective owners.  This is
  372. shareware.  To register, please send $15.00 (or $25.00 if you also want
  373. original disks) to:
  374.  
  375.     Mike Johnson
  376.     PO BOX 1151
  377.     LONGMONT CO 80502-1151
  378.     USA
  379.  
  380. Registration entitles you to support on the Rainbow Missions BBS
  381. (303-938-9654) and by mail, and to notification of major upgrades at discount
  382. rates.
  383.  
  384. Although I try to write perfect software, there is a chance that I goofed up
  385. in some way.  If you find this to be the case, please let me know so that I
  386. can repair it.  Because I can't test every possible use of this software on
  387. every system that it might be run on, and because I have no control over the
  388. way shareware gets passed around, you use this software entirely at your own
  389. risk.  Prices are subject to change without notice.
  390.  
  391.  
  392. HISTORY
  393.  
  394. 1.00  5 Sep 92  Initial release.
  395. 1.01  7 Sep 92  Modified to allow recursive copies of hidden subdirectories.
  396. 1.02  9 Sep 92  Corrected handling of . and .. as source or destination 
  397.                 directory name.
  398. 1.03 20 Sep 92  Added /C switch to specify overwrites of all but identical
  399.                 files.
  400. 1.04 22 Sep 92  Added /B switch to allow individual prompts for overwrites.
  401.  
  402.